import app as robot_script

class Ai:

    def __init__(self, framework):
        self.framework = framework
        self.text_detection = False
        self.qrcode = False
        self.gesture = False
        self.face_detection = False
        self.face_detect = False
        self.body_detection = False
    
    def set_state(self, state):
        if state == "text_detection":
            self.text_detection = True
            self.framework.socket.write({"operate": "run_log", "type": "ai_state", "data": "text_detection"})
        if state == "qrcode":
            self.qrcode = True
            self.framework.socket.write({"operate": "run_log", "type": "ai_state", "data": "qrcode"})
        if state == "gesture":
            self.gesture = True
            self.framework.socket.write({"operate": "run_log", "type": "ai_state", "data": "gesture"})
        if state == "face_detection":
            self.face_detection = True
            self.framework.socket.write({"operate": "run_log", "type": "ai_state", "data": "face_detection"})
        if state == "face_detect":
            self.face_detect = True
            self.framework.socket.write({"operate": "run_log", "type": "ai_state", "data": "face_detect"})
        if state == "body_detection":
            self.body_detection = True
            self.framework.socket.write({"operate": "run_log", "type": "ai_state", "data": "body_detection"})
